@import plugins.Context
@import org.silkframework.rule.execution.ExecuteTransform
@import views.html.workspace.activity.taskActivityControl
@import controllers.transform.routes.ExecuteTransformTab
@import org.silkframework.rule.TransformSpec

@(context: Context[TransformSpec])(implicit session: play.api.mvc.Session)

@header = {
  <script type="text/javascript">
    function updateStatistics() {
      $( "#statistics_wrapper" ).load('@ExecuteTransformTab.executeStatistics(context.project.name, context.task.id).url');
    }
  </script>
}

@toolbar = {
  <ul>
    <li>
      @taskActivityControl(context.task.activity[ExecuteTransform], showButtons = true)
    </li>
    <li>
      <button id="button_statistics" class="mdl-button mdl-js-button mdl-button--raised" onclick="updateStatistics()">Validation Report</button>
      <div class="mdl-tooltip mdl-tooltip--large" for="button_statistics">
        Loads the validation report about the current transform execution.
      </div>
    </li>
  </ul>
}

@content = {
  <div id="statistics_wrapper"></div>
}

@main(Some(context))(header)(toolbar)(content)
